<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<script type="text/javascript">
$(document).ready(function(){
	$("select[name='deskCode']").change(function(){
		var deskCode = $(this).find("option:selected").val();
		//alert(deskCode);
		location.href = "/channel/channelList.desk?deskCode=" + deskCode;
	});
	
	$("#order").change(function(){
		$("#channelList").attr('action','/channel/channelList.desk').submit();
	});
});
</script>
<link rel="stylesheet" type="text/css" href="/css/cooperation.css"/>
<script type="text/javascript" src="/js/channel.js"></script>

<s:url id="listURLPrev" value="/channel/channelList.desk">
	<s:param name="pageNumber">
		<s:property value="pageInfoDataMap.pageNumber - 1"/>
	</s:param>
	<s:param name="deskCode">
		<s:property value="deskCode"/>
	</s:param>
</s:url>

<s:url id="listURLNext" value="/channel/channelList.desk">
	<s:param name="pageNumber">
		<s:property value="pageInfoDataMap.pageNumber + 1"/>
	</s:param>
	<s:param name="deskCode">
		<s:property value="deskCode"/>
	</s:param>
</s:url>
<s:set name="currentPageNumber" value="pageNumber"/>

<s:set name="totalCount" value="%{totalCount}"/>
<s:set name="authCode" value="%{authCode}"/>

<form name="channelList" id="channelList" method="post">
<input type="hidden" name="deskCodeForExcel" value="<s:property value="#session.deskCode"/>"/>
<input type="hidden" name="userSeq" value="<s:property value="#session.userSeq"/>"/>
<input type="hidden" name="authCode" value="<s:property value="#session.authCode"/>"/>
<input type="hidden" name="reportGubun" value="channel"/>

 <dl class="Right_Contents_area">
        <dd class="Center_Top_title"> <span class="top_title"><img src="/images/report/cooperation/SubContents_Tit_01.gif" width="370" height="42" alt="협력채널 구축 실적" /></span> <span class="top_navi">HOME > 업무보고 > 협력채널 구축 실적</span></dd>
        <dd class="Right_Contents_Search"><img src="/images/report/apply/SubContents_Tit_CenterChoice.gif" width="81" height="21" alt="센터선택" /></dd>
         <dd class="Right_Contents_SearchOption">
         	<s:if test="#authCode == 'ADMIN'">
         		<s:include value="/view/include/common/deskcode/deskcode_total.jsp"/>
   			</s:if>
	   		<s:if test="#authCode != 'ADMIN'">
	   			<s:include value="/view/include/common/deskcode/deskcode_consultant.jsp"/>
	   		</s:if>
	   		<s:set name="dCode" value="%{deskCode}"/>
        </dd>
        <dd class="Right_Contents_Notice">총 <span class="TEXT_Red_Bold"><s:property value="#totalCount"/></span>건의 실적정보 검색됨</dd>
        <dd class="Right_Contents_NoticeBtn"><img src="/images/notice/btn_ExelDown.gif" id="btn_excel_download" width="114" height="26" alt="엑셀다운로드" style="cursor:pointer"/></dd>
        <dd style="text-align:right;">
    		<label for="state">&nbsp;&nbsp;&nbsp;정렬 : </label>
        	<s:select name="order" id="order" list="#{'regTime':'일자▼','regTime2':'일자▲','channelTitle':'목적','channelPlace':'장소' }" />
    	</dd>

</form>    	
        <dd class="Center_Top_contents">
          <div id="LIst_Zone">
            <dl>
              <dd>
                <table cellspacing="0" border="1" summary="글목록" class="Listboard">
                  <caption>글목록</caption>
                  <colgroup><col width="55"><col width="1"><col width="324"><col width="1"><col width="254"><col width="1"><col width="83"></colgroup>
                  <thead>
                    <tr>
                      <th scope="col">번호</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">목적</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">장소</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">일자</th>
                    </tr>
                  </thead>
                  <!-- 등록된 글이 없을때 나오는것 
                  <tbody>
                   <tr>
                     <td colspan="9">등록된 글이 없습니다.</td>
                   </tr>                                         
                  </tbody>
                  등록된 글이 없을때 나오는것 -->
                  <!-- 리스트 부분 -->
                  <tbody>
                   	<s:if test="channelList.size == 0">
                  		<tr>
                  			<td colspan="9" style="text-align:center">조회된 결과가 없습니다.</td>
                  		</tr>
                  	</s:if>
                    <s:if test="channelList.size !=0">
                  		<s:iterator value="channelList" status="stat">
		                    <tr>
		                      <td><s:property value="(#totalCount + 1 - ((pageInfoDataMap.pageNumber - 1) * pageInfoDataMap.countPerPage)) - (#stat.count)"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td class="tdTit">
		                      		<a href="/channel/channelDetail.desk?channelSeq=<s:property value="channelSeq"/>&pageNumber=<s:property value="#currentPageNumber"/>&deskCode=<s:property value="deskCode"/>"><s:property value="channelTitle"/></a>
		                      </td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td class="tdTit"><s:property value="channelPlace"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td><s:property value="regTime"/></td>
		                    </tr>     		
                  		</s:iterator>
                  	</s:if>  
                  </tbody>
                  <!-- 리스트 부분 -->
                </table>
              </dd>
               
            </dl> 
            <dl class="List_Page_area"><!-- 리스트 페이징 부분 -->
              <dd class="page_area">
                <div class="paginate">
                    <s:if test="pageInfoDataMap.startPage > pageInfoDataMap.pagePerBlock">
						<s:a href="%{listURLPrev}" cssClass="pre">이전페이지</s:a>
					</s:if>
			      	<c:forEach var="pageNum" begin="${pageInfoDataMap.startPage}" end="${pageInfoDataMap.endPage}">
						<c:choose>
							<c:when test="${pageNum != 0 && pageNum == pageInfoDataMap.pageNumber}">
								<strong>${pageNum}</strong>
							</c:when>
							<c:when test="${pageNum == 0 }">
							
							</c:when>
							<c:otherwise>
								<a href="<c:url value="/channel/channelList.desk?pageNumber=${pageNum}&deskCode=${deskCode}"/>"> ${pageNum} </a>
							</c:otherwise>
						</c:choose>
					</c:forEach>
			      	<s:if test="pageInfoDataMap.endPage < pageInfoDataMap.totalPageCount">
						<s:a href="%{listURLNext}" cssClass="next">다음페이지</s:a>
					</s:if>
                </div>               
              </dd>            
            </dl><!-- 리스트 페이징 부분 -->
            <dl class="List_Btn_area"><!-- 버튼 부분 -->
             <dd class="Left_Zone"><a href="/channel/channelList.desk"><img src="/images/notice/btn_list.gif" alt="목록" width="52" height="26" border="0" /></a></dd>
              <s:if test="#orgCode != 'KIPO'">
              	<s:if test="#authCode == 'CONSULTANT'">
	              	<s:if test="#session.deskCode == #dCode">
	             		<dd class="Right_Zone"><a href="/channel/channelForm.desk"><img src="/images/report/cooperation/btn_write.gif" width="163" height="26" alt="협력채널 구축 실적 등록" border="0" /></a></dd>
	             	</s:if>
             	</s:if>
             	<s:if test="#authCode == 'ADMIN_ORG'">
             		<dd class="Right_Zone"><a href="/channel/channelForm.desk"><img src="/images/report/cooperation/btn_write.gif" width="163" height="26" alt="협력채널 구축 실적 등록" border="0" /></a></dd>
             	</s:if>
             	<s:if test="#authCode == 'ADMIN'">
             		<dd class="Right_Zone"><a href="/channel/channelForm.desk"><img src="/images/report/cooperation/btn_write.gif" width="163" height="26" alt="협력채널 구축 실적 등록" border="0" /></a></dd>
             	</s:if>
             </s:if>
            </dl><!-- 버튼 부분 -->                   
          </div>
        </dd>
      </dl>
      <!-- 오른쪽 내용 끝 --> 
    </div>
  </div>
  <!-- center 나누어 지는 부분 끝 --> 
</div>